package com.eps.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author CAROLINA
 */
@Entity
@Table(name = "Pabellon")
@NamedQueries({@NamedQuery(name = "Pabellon.findAll", query = "SELECT p FROM Pabellon p"), @NamedQuery(name = "Pabellon.findByIdPabellon", query = "SELECT p FROM Pabellon p WHERE p.idPabellon = :idPabellon"), @NamedQuery(name = "Pabellon.findByDescripcion", query = "SELECT p FROM Pabellon p WHERE p.descripcion = :descripcion")})
public class Pabellon implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_Pabellon")
    private Long idPabellon;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(mappedBy = "idPabellon")
    private List<Estante> estanteList;
    @JoinColumn(name = "id_Ambiente", referencedColumnName = "id_Ambiente")
    @ManyToOne
    private Ambiente idAmbiente;

    public Pabellon() {
    }

    public Pabellon(Long idPabellon) {
        this.idPabellon = idPabellon;
    }

    public Long getIdPabellon() {
        return idPabellon;
    }

    public void setIdPabellon(Long idPabellon) {
        this.idPabellon = idPabellon;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public List<Estante> getEstanteList() {
        return estanteList;
    }

    public void setEstanteList(List<Estante> estanteList) {
        this.estanteList = estanteList;
    }

    public Ambiente getIdAmbiente() {
        return idAmbiente;
    }

    public void setIdAmbiente(Ambiente idAmbiente) {
        this.idAmbiente = idAmbiente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPabellon != null ? idPabellon.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof Pabellon)) {
            return false;
        }
        Pabellon other = (Pabellon) object;
        if ((this.idPabellon == null && other.idPabellon != null) || (this.idPabellon != null && !this.idPabellon.equals(other.idPabellon))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.Pabellon[idPabellon=" + idPabellon + "]";
    }

}
